package com.wuye.web;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by xieyp on 2015/6/13.
 */
public class ParamUtil {
    public static int getInt(HttpServletRequest request, String name) {
        return getInt(request, name, 0);
    }

    public static int getInt(HttpServletRequest request, String name, int defaultVal) {
        String v = request.getParameter(name);
        if (LangUtil.isNum(v)) return Integer.parseInt(v);
        return defaultVal;
    }
}
